package com.lhh.springcloud.controller;

import com.lhh.entity.Result;
import com.lhh.springcloud.entity.Storage;
import com.lhh.springcloud.service.StorageService;
import com.lhh.springcloud.service.imp.StorageServiceImp;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author 李洪豪
 * @Sno 20220301044
 */
@RestController
public class StorageController {
    @Resource
    private StorageService storageService;
    @PostMapping("/storage/reduce")
    public Result updateStorage(@RequestParam(value = "product_id") Long product_id,
                                         @RequestParam(value = "nums") Integer nums){
        storageService.updateStorage(product_id,nums);
        return Result.success("扣减库存成功",null);
    }
}
